<?php

if ($_GET['skin']<>"")
{
 if(file_exists(BX_DIRECTORY_PATH_MODULES.'ibdw/spywall/templates/'.$_GET['skin'].'/css/spywallstyle.css'))
 {
  $mytemplatepath='templates/'.$_GET['skin'].'/css/';
  $imagepath='modules/ibdw/spywall/templates/'.$_GET['skin'].'/css/immagini/';
 }
 else
 {
  $mytemplatepath='templates/uni/css/';
  $imagepath='modules/ibdw/spywall/templates/uni/css/immagini/';
 }
}
elseif (isset($_COOKIE['skin']))
{
 if(file_exists(BX_DIRECTORY_PATH_MODULES.'ibdw/spywall/templates/'.$_COOKIE['skin'].'/css/spywallstyle.css'))
 {
  $mytemplatepath='templates/'.$_COOKIE['skin'].'/css/';
  $imagepath='modules/ibdw/spywall/templates/'.$_COOKIE['skin'].'/css/immagini/';
 }
 else
 {
  $mytemplatepath='templates/uni/css/';
  $imagepath='modules/ibdw/spywall/templates/uni/css/immagini/';
 }
}
else
{
$myquerytemplate="SELECT VALUE from sys_options WHERE Name='template'";
$risultempl = mysql_query($myquerytemplate,$db) or die(mysql_error());
$estratempl = mysql_fetch_assoc($risultempl);
$mytemplatepath='templates/'.$estratempl['VALUE'].'/css/';
 if(file_exists(BX_DIRECTORY_PATH_MODULES.'ibdw/spywall/'.$mytemplatepath.'spywallstyle.css'))
 {
  $imagepath='modules/ibdw/spywall/templates/'.$estratempl['VALUE'].'/css/immagini/';
 }
 else
 {
  $mytemplatepath='templates/uni/css/';
  $imagepath='modules/ibdw/spywall/templates/uni/css/immagini/';
 }
}

?>
